knitr::opts_chunk$set(echo = TRUE) require(ggSimple) require(scales)
Initialise a plot instance with Plot()
:
Plot(iris)
Add a line to the chart, specifying a group option:
Line(x="Sepal.Length", y="Petal.Length", group = "Species")
Adjust the line colours for the group:
Group_Colours(c("Orange", "Green", "Purple"))
Change the x scale to display scientific, and y scale to display pounds.
Scales(x = "scientific", y = "pound")
Add a title and labels (Labels()
by default will try to beautify your x/y labels):
Labels(title = "My Test Plot")
Finally print the plot with Show_Plot()
Show_Plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.